﻿using System;

namespace Kay.Communication.Framework.Custom_EventArgs
{
    /// <summary>
    /// 为文件消息到达事件提供数据
    /// </summary>
    public class FileMessageReceivedEventArgs : EventArgs
    {
        /// <summary>
        /// 初始化文件消息事件数据
        /// </summary>
        /// <param name="user">用户信息</param>
        /// <param name="info">文件信息</param>
        /// <param name="bytes">字节</param>
        public FileMessageReceivedEventArgs(ContactsInfo user, TransferFileInfo info, byte[] bytes)
        {
            if (user == null) throw new ArgumentNullException("user");
            UserInfo = user;
            TransferFileInfo = info;
            Bytes = bytes;
        }

        /// <summary>
        /// 获取或设置文件数据
        /// </summary>
        public ContactsInfo UserInfo { get; set; }

        /// <summary>
        /// 获取或设置文件信息
        /// </summary>
        public TransferFileInfo TransferFileInfo { get; set; }

        /// <summary>
        /// 获取或设置字节
        /// </summary>
        public byte[] Bytes { get; set; }

        /// <summary>
        /// 是否完成
        /// <para>True 表示发送文件的哈希码与接收文件的哈希码相同，否则为 False。</para>
        /// </summary>
        public bool IsComplete { get; set; }
    }
}